package pers.vic.upload.utils;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import pers.vic.upload.constant.CommandEnum;
import pers.vic.upload.constant.FileType;
import pers.vic.upload.socket.model.InitCommandInfo;
import pers.vic.upload.socket.model.ProgressInfo;

/**
 * 描述:
 * @author Vic.xu
 * @date 2022-07-19 11:40
 */
public class Print {

    public static void print(Object o) throws JsonProcessingException {
        String s = new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(o);
        System.out.println(s);
    }

    public static void main(String[] args) throws JsonProcessingException {
        InitCommandInfo info = new InitCommandInfo();
        info.setCommand(CommandEnum.init);
        info.setFilename("next.pdf");
        info.setTotal(10000);
        info.setType(FileType.insurance);
        print(new ObjectMapper().writeValueAsString(info));
    }
}
